<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    body{
        padding: 0;
        margin: 0;
    }
    .center{
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);

    }
    span{
        position: absolute;
        width: 20px;
        height: 20px;
        background: #262626;
        animation: anmitate 4s infinite ease-in-out;
    }
    @keyframes anmitate {
        0%{
            transform: rotateY(0deg);
        }
        20%{
            transform: rotateY(360deg);
        }
        40%{
            transform: rotateX(180deg);
        }
        60%{
            transform: rotateX(0deg);
        }
        80%{
            transform: rotateX(360deg);
        }
        100%{
            transform: rotateY(180deg);
        }
    }

    span:nth-child(1){
        background: #00485f;
        left: -24px;
        top: -24px;
        animation-delay: .2s;
    }
    span:nth-child(2){
        background: #00deea;
        left: 0px;
        top: -24px;
        animation-delay: .4s;
    }
    span:nth-child(3){
        background: #00deea;
        left: -24px;
        top: 0px;
        animation-delay: .6s;
    }
    span:nth-child(4){
        background: #00485f;
        left: 0;
        top: 0;
        animation-delay: .8s;
    }


</style>
<body>
    <div class="center">
        <span></span>
        <span></span>
        <span></span>
        <span></span>
    </div>

</body>
</html>